package com.ytjj.qmyx.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.dao.PayConfigDao;
import com.ytjj.qmyx.admin.model.request.PayConfigRequest;
import com.ytjj.qmyx.admin.service.PayConfigService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class PayConfigServiceImpl implements PayConfigService {
    @Resource
    private PayConfigDao payConfigDao;
    @Override
    public CommonPage list(PayConfigRequest payConfigRequest) {
        PageHelper.startPage(payConfigRequest.getPageNum(),payConfigRequest.getPageSize());
        List list = payConfigDao.list(payConfigRequest);
        return CommonPage.restPage(list);
    }

    @Override
    public int updateById(PayConfigRequest payConfigRequest) {
        payConfigRequest.setUpdateTime(new Date());
        int count = payConfigDao.updateById(payConfigRequest);
        return count;
    }
}
